home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 August: Tool Chest / Dev.CD Aug 94.toast / New System Software Extensions / OpenDoc A6 / SOM / OpenDoc and SOM / CPlusPlus / ODCtr.xh < prev    next >
Encoding:
Text File  |  1994-04-19  |  5.6 KB  |  248 lines  |  [TEXT/MPS ]

  1.  
  2. /*
  3.  * This file was generated by the SOM Compiler.
  4.  * FileName: Locrian:WWDCSun:CPlusPlus:ODCtr.xh.
  5.  * Generated using:
  6.  *     SOM Precompiler somipc: somc/smemit.c
  7.  *     SOM Emitter emitxh.dll: somc/smmain.c
  8.  */
  9.  
  10. /*
  11.  * 
  12.  *  Constants
  13.  * 
  14.  */
  15.  
  16.  
  17. #ifndef SOM_ODContainer_xh
  18. #define SOM_ODContainer_xh
  19.  
  20. class ODContainer;
  21.  
  22. #define ODContainer_MajorVersion 0
  23. #define ODContainer_MinorVersion 0
  24.  
  25. /* C++ som defs */
  26. #include <somcls.xh>
  27.  
  28. /* Include C++ parent defs */
  29. #ifndef SOM_ODRefCntObject_xh
  30. #include <RefCtObj.xh>
  31. #endif
  32.  
  33. #ifndef ODContainer_API
  34. #define ODContainer_API
  35. /*
  36.  * -- The Class API
  37.  */
  38.  
  39. /*
  40.  * Start of user-defined types:
  41.  */
  42. class ODExtension;
  43. class ODStorageSystem;
  44. class ODStorageUnitCursor;
  45. class ODLinkSource;
  46. class ODSession;
  47. class ODStorageUnitRefIterator;
  48. class ODLink;
  49. class ODPart;
  50. class ODStorageUnitView;
  51. class ODLinkSpec;
  52. class ODFrame;
  53. class ODShape;
  54.  
  55. /*
  56.  * End of user-defined types.
  57.  */
  58.  
  59. #if applec ^ PRAGMA_LIB_EXPORT
  60. #pragma lib_export on
  61. #endif
  62.  
  63.  
  64. /* A procedure to create the ODContainer Class */
  65. SOMEXTERN SOMClass * SOMLINK ODContainerNewClass(
  66.         integer4 majorVersion,
  67.         integer4 minorVersion);
  68.  
  69. /* The API to the ODContainer class object, and the methods it introduces. */
  70. typedef struct ODContainerClassDataStructure {
  71.     SOMClass *classObject;
  72.     somMToken GetStorageSystem;
  73.     somMToken GetID;
  74.     somMToken GetName;
  75.     somMToken SetName;
  76.     somMToken GetDocument;
  77.     somMToken InitContainer;
  78.     somMToken Create;
  79.     somMToken Open;
  80.     somMToken Close;
  81.     somMToken ReleaseDocument;
  82. } ODContainerClassDataStructure;
  83. #ifdef SOM_NO_DATA_EXPORTS
  84.    SOMEXTERN ODContainerClassDataStructure * ODContainerGetClassData ( void );
  85. #   undef ODContainerClassData
  86. #   define ODContainerClassData (*ODContainerGetClassData())
  87. #else
  88.    SOMEXTERN ODContainerClassDataStructure ODContainerClassData;
  89. #endif /* SOM_NO_DATA_EXPORTS */
  90.  
  91. #if applec ^ PRAGMA_LIB_EXPORT
  92. #pragma lib_export off
  93. #endif
  94.  
  95. #define _ODContainer ODContainerClassData.classObject
  96.  
  97. /* The API to parentMtabs for ODContainer, and the instance data it introduces. */
  98. SOMEXTERN struct ODContainerCClassDataStructure {
  99.     somMethodTabs parentMtab;
  100.     somDToken instanceDataToken;
  101. } ODContainerCClassData;
  102.  
  103. /*
  104.  * -- Typedefs for Procedures that support Methods introduced by ODContainer
  105.  */
  106. SOMEXTERN {
  107. typedef ODStorageSystem*   (* SOMLINK somTD_ODContainer_GetStorageSystem)(ODContainer *somSelf, Environment *ev);
  108. typedef ODContainerID   (* SOMLINK somTD_ODContainer_GetID)(ODContainer *somSelf, Environment *ev);
  109. typedef ODContainerName   (* SOMLINK somTD_ODContainer_GetName)(ODContainer *somSelf, Environment *ev);
  110. typedef void   (* SOMLINK somTD_ODContainer_SetName)(ODContainer *somSelf, Environment *ev,
  111.         ODContainerName name);
  112. typedef ODDocument*   (* SOMLINK somTD_ODContainer_GetDocument)(ODContainer *somSelf, Environment *ev,
  113.         ODDocumentID id);
  114. typedef void   (* SOMLINK somTD_ODContainer_InitContainer)(ODContainer *somSelf, Environment *ev,
  115.         ODStorageSystem* system,
  116.         ODContainerID id);
  117. typedef ODContainer*   (* SOMLINK somTD_ODContainer_Create)(ODContainer *somSelf, Environment *ev);
  118. typedef ODContainer*   (* SOMLINK somTD_ODContainer_Open)(ODContainer *somSelf, Environment *ev);
  119. typedef ODContainer*   (* SOMLINK somTD_ODContainer_Close)(ODContainer *somSelf, Environment *ev);
  120. typedef ODContainer*   (* SOMLINK somTD_ODContainer_ReleaseDocument)(ODContainer *somSelf, Environment *ev,
  121.         ODDocument* document);
  122. }
  123.  
  124. #endif /* ODContainer_API */
  125.  
  126.  
  127. /*
  128.  * -- Method Tokens are Thunks
  129.  */
  130. #undef somresolve_
  131. #define somresolve_(obj,mToken) ((somMethodProc*)((void)obj, mToken))
  132.  
  133. /*
  134.  * -- The C++ Wrapper Class for ODContainer
  135.  */
  136. class ODContainer : public ODRefCntObject
  137. {
  138. public:
  139.  
  140. void *operator new(size_t size)
  141. {
  142.    SOM_IgnoreWarning(size);
  143.    if (!ODContainerClassData.classObject) 
  144.       ODContainerNewClass(ODContainer_MajorVersion,ODContainer_MinorVersion);
  145.    return (void *)
  146.       ((somTD_SOMClass_somNew)
  147.       somresolve_((SOMObject *)((void*)(ODContainerClassData.classObject)),
  148.                  SOMClassClassData.somNew))
  149.          ((SOMClass *)((void*)(ODContainerClassData.classObject)));
  150. }
  151.  
  152. void operator delete(void * obj)
  153. {
  154.    ((SOMObject *)obj)->somFree();
  155. }
  156.  
  157. /* public method: GetStorageSystem */
  158. ODStorageSystem*   GetStorageSystem(Environment *ev)
  159. {
  160.    return SOM_Resolve(this,ODContainer,GetStorageSystem)
  161.     (this,ev);
  162. }
  163.  
  164.  
  165. /* public method: GetID */
  166. ODContainerID   GetID(Environment *ev)
  167. {
  168.    return SOM_Resolve(this,ODContainer,GetID)
  169.     (this,ev);
  170. }
  171.  
  172.  
  173. /* public method: GetName */
  174. ODContainerName   GetName(Environment *ev)
  175. {
  176.    return SOM_Resolve(this,ODContainer,GetName)
  177.     (this,ev);
  178. }
  179.  
  180.  
  181. /* public method: SetName */
  182. void   SetName(Environment *ev,
  183.         ODContainerName name)
  184. {
  185.    SOM_Resolve(this,ODContainer,SetName)
  186.     (this,ev,name);
  187. }
  188.  
  189.  
  190. /* public method: GetDocument */
  191. ODDocument*   GetDocument(Environment *ev,
  192.         ODDocumentID id)
  193. {
  194.    return SOM_Resolve(this,ODContainer,GetDocument)
  195.     (this,ev,id);
  196. }
  197.  
  198.  
  199. /* public method: InitContainer */
  200. void   InitContainer(Environment *ev,
  201.         ODStorageSystem* system,
  202.         ODContainerID id)
  203. {
  204.    SOM_Resolve(this,ODContainer,InitContainer)
  205.     (this,ev,system,id);
  206. }
  207.  
  208.  
  209. /* public method: Create */
  210. ODContainer*   Create(Environment *ev)
  211. {
  212.    return SOM_Resolve(this,ODContainer,Create)
  213.     (this,ev);
  214. }
  215.  
  216.  
  217. /* public method: Open */
  218. ODContainer*   Open(Environment *ev)
  219. {
  220.    return SOM_Resolve(this,ODContainer,Open)
  221.     (this,ev);
  222. }
  223.  
  224.  
  225. /* public method: Close */
  226. ODContainer*   Close(Environment *ev)
  227. {
  228.    return SOM_Resolve(this,ODContainer,Close)
  229.     (this,ev);
  230. }
  231.  
  232.  
  233. /* public method: ReleaseDocument */
  234. ODContainer*   ReleaseDocument(Environment *ev,
  235.         ODDocument* document)
  236. {
  237.    return SOM_Resolve(this,ODContainer,ReleaseDocument)
  238.     (this,ev,document);
  239. }
  240.  
  241.  
  242.  
  243. };   /* ODContainer */
  244.  
  245.  
  246.  
  247. #endif       /* SOM_ODContainer_xh */
  248.